Adds a sidebar node or nodes.

<div class="definition">
    add([parent], nodes)
</div>

<div class="arguments">
    <table>
    <tr>
        <td>parent</td>
        <td><b>string</b>, id of the parent node (<i>optional</i>)</td>
    </tr>
    <tr>
        <td>nodes</td>
        <td><b>object</b> or <b>array</b>, sidebar nodes to add</td>
    </tr>
    </table>
</div>

Returns object.

<h4>Description</h4>

The <span class="argument">nodes</span> argument can be either an object or array of objects. If it is an object it
represents a sidebar node that will be added to <a class="property" href="w2sidebar.nodes">.nodes</a> array.
If it is an array then each element of the array will be treated as a separate sidebar node object.
<div style="height: 10px"></div>

The first optional argument <span class="argument">parent</span> is an id of the parent node or parent node itself. If
parent node is not specified, new nodes will be inserted at the root level.
<div style="height: 10px"></div>

The method will return last inserted node.
<div style="height: 10px"></div>

If you defined the object in the following way:
<textarea class="javascript">
let sidebar = new w2sidebar({
    name : 'sidebar',
    img  : 'icon-page',
    nodes: [
        { id: 'id-1', text: 'Level 1' },
        { id: 'id-2', text: 'Level 2' },
        { id: 'id-3', text: 'Level 3' }
    ]
});
</textarea>

You can:
<textarea class="javascript">
w2ui.sidebar.add('id-1', { id: 'id-1-1', text: 'Level 1-1' });
// or
w2ui.sidebar.add('id-2', [
    { id: 'id-2-1', text: 'Level 2-1' },
    { id: 'id-2-2', text: 'Level 2-2' },
    { id: 'id-2-3', text: 'Level 2-3' }
]);
</textarea>
